/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.mala.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author joao
 */
@Embeddable
public class RolesModulosPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "role_id", nullable = false)
    private int roleId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "modulo_id", nullable = false)
    private int moduloId;

    public RolesModulosPK() {
    }

    public RolesModulosPK(int roleId, int moduloId) {
        this.roleId = roleId;
        this.moduloId = moduloId;
    }

    public int getRoleId() {
        return roleId;
    }

    public void setRoleId(int roleId) {
        this.roleId = roleId;
    }

    public int getModuloId() {
        return moduloId;
    }

    public void setModuloId(int moduloId) {
        this.moduloId = moduloId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) roleId;
        hash += (int) moduloId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RolesModulosPK)) {
            return false;
        }
        RolesModulosPK other = (RolesModulosPK) object;
        if (this.roleId != other.roleId) {
            return false;
        }
        if (this.moduloId != other.moduloId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.mala.entity.RolesModulosPK[ roleId=" + roleId + ", moduloId=" + moduloId + " ]";
    }
    
}
